class Material {
public:
	
	vec4 color;
	vec4 ambient;
	vec4 diffuse;
	vec4 specular;
	vec4 emission;
	float shininess;

	Texture texture;
	
	void bind(){
		glColor4fv(value_ptr(color));
		glMaterialfv(GL_FRONT_AND_BACK,GL_AMBIENT,value_ptr(ambient));
		glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,value_ptr(diffuse));
		glMaterialfv(GL_FRONT_AND_BACK,GL_SPECULAR,value_ptr(specular));
		glMaterialfv(GL_FRONT_AND_BACK,GL_EMISSION,value_ptr(emission));
		glMaterialfv(GL_FRONT_AND_BACK,GL_SHININESS,&shininess);
		glBindTexture(GL_TEXTURE_2D,texture._texture);
	}
	
	void clear(){
		color = vec4(1.0,1.0,1.0,1.0);
		ambient = vec4(0.2,0.2,0.2,1.0);
		diffuse = vec4(0.8,0.8,0.8,1.0);
		specular = vec4(0.0,0.0,0.0,1.0);
		emission = vec4(0.0,0.0,0.0,1.0);
		shininess = 0;
	}

	Material(){
		clear();
	}
	
};
